﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BugTracker.Core.Infrastructure.Entities;

namespace BugTracker.Core.Infrastructure.Interfaces
{
    public interface IDataService<T> where T: BaseEntity
    {
        IList<T> Load();
        IList<T> LoadIncludeInactive();
        IList<T> Page(int pageIndex, int pageSize, out int count);
        IList<T> PageSort(int pageIndex, int pageSize, string sortColumn, string sortDirection, out int count);
        IList<T> PageSortWhere(int pageIndex, int pageSize, string sortColumn, string sortDirection, string whereColumn, string whereClause, out int count);
        T LoadById(int id);
        T LoadByGuid(Guid guid);
        int Count();
        int CountIncludeInactive();
        bool HasChanged(int id);
        bool HasChanged(Guid guid);
        void MakeInactive(T value);
        void InsertObject(T value);
        void UpdateObject(T value);
        void DeleteObject(T value);
        void DeleteObject(int id);
        void DeleteObject(Guid guid);
        bool HasDuplicate(T value);
    }
}
